<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    
	
	<title>_作业日志</title>
	
	  <script type="text/javascript">
      
        //美化车载信息
		function formatInfo(carInfo) {
			var carInfoArray = carInfo.split(";");
			var temp = '';
			for ( var i = 0; i < carInfoArray.length; i++) {
				var car = carInfoArray[i];
				if (car == null || car == '') {
				} else {
					temp += "【" + car + "(件)】<br/>";
				}
			}
			return temp;
		}
		
		function showBillDetail(){
	      var flag=$("#showOrhide").html();
	      
	      if(flag=="【隐藏明细】"){
	        $("#billDetail").css("display","none");
	        $("#showOrhide").html("【查看明细】");
	      }
	      else if(flag=="【查看明细】"){
	        $("#billDetail").css("display","");
	        $("#showOrhide").html("【隐藏明细】");
	      }
	    }

	</script>
	
</head>



<body>
<section class="content">
 <div class="form-group row">
		<div class="col-md-12">
			<div class="box box-solid box-primary">
				<div class="box-header">
					<h3 class="box-title">作业批次信息</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse" type="button">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
	<div class="box-body">
	<!-- 作业信息 -->	
	<table id="contentTable" class="table  table-bordered table-condensed">
		<thead><tr>
		    <th>商家</th>
		    <th>仓库</th>
		    <th>批次</th>
			<th>订单类型</th>
			<th>作业模式</th>
			<th>运单类型</th>
			<th>订单数量</th>
			<th>创建人</th>
			<th>创建时间</th>
			<th>完成时间</th>
			<th>批次状态</th>
		 </tr></thead>
		 <tr>
	       <td>${batch.customer.customerName}</td>
	       <td>${batch.warehouse.groupName}</td>
	       <td>${batch.batchCode}</td>
	       <td>
	          <c:if test="${batch.pickType eq 'single'}">单件</c:if>
			  <c:if test="${batch.pickType eq 'multi'}">多件</c:if>
	       </td>
	       <td>
	          <c:if test="${batch.flowType eq 'prePrint'}">预先打单</c:if>
			  <c:if test="${batch.flowType eq 'intimePrint'}">及时打单</c:if>
	       </td>
	       <td>
	          <c:if test="${batch.billType eq 'cbill'}">普通运单</c:if>
			  <c:if test="${batch.billType eq 'ebill'}">电子运单</c:if>
	       </td>
	       <td>${batch.orderQty}</td>
	       <td>${batch.creater.realname}</td>
	       <td>${fn:substring(batch.createTime,0,19)}</td>
	       <td>${fn:substring(batch.finishTime,0,19)}</td>
	       <td>
	          <!-- 批次状态 (1.已创建批次 2.已创建任务 3.已拣货 4.已包装  5.已发货) -->
			     <c:if test="${batch.status eq '1'}">已创建批次</c:if>
			     <c:if test="${batch.status eq '2'}">已创建任务</c:if>
			     <c:if test="${batch.status eq '3'}">已拣货</c:if>
			     <c:if test="${batch.status eq '4'}">已包装</c:if>
			     <c:if test="${batch.status eq '5'}">已发货</c:if>
	       </td>
		 </tr>
	</table>
	</div>
	</div>
	</div>
	</div>
	  
	  
<div class="form-group row">
		<div class="col-md-12">
			<div class="box box-solid box-primary">
				<div class="box-header">
					<h3 class="box-title">作业任务信息</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse" type="button">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
	<div class="box-body">
	   <!-- 作业任务信息-->
	  <table class="table table-striped table-bordered table-condensed" id="billDetail">
	  	<thead>
          <tr>
             <th style="width: 120px;">任务</th>
             <th style="width: 120px;">订单数量</th>
             <th style="width: 100px;">拣货模式</th>
             <th style="width: 170px;">创建时间</th>
             <th style="width: 170px;">完成时间</th>
             <th style="width: 100px;">创建人</th>
             <th style="width: 100px;">任务状态</th>
          </tr></thead>
          <c:forEach  items="${taskList}" var="task">
             <tr>
               <td><a href='${ctx}/print/v2_toReprintPage/${task.taskCode}'>${task.taskCode}</a></td>
               <td>${task.orderQty}</td>
                <td>
                 <c:if test="${task.pickModel eq 'lamp'}"><font color=blue>【灯光拣选】</font></c:if>
			     <c:if test="${task.pickModel eq 'car'}"><font color=red>【推车拣选】</font></c:if>
               </td>
               <td>${fn:substring(task.createTime,0,19)}</td>
               <td>${fn:substring(task.finishTime,0,19)}</td>
               <td>${task.creater.realname}</td>
               <td>
                 <c:if test="${task.status eq '1'}">创建任务</c:if>
			     <c:if test="${task.status eq '2'}">已分配拣货任务</c:if>
			     <c:if test="${task.status eq '3'}">已拣货</c:if>
			     <c:if test="${task.status eq '4'}">已分配灯光拣选任务</c:if>
			     <c:if test="${task.status eq '5'}">已经灯光拣选</c:if>
			     <c:if test="${task.status eq '6'}">已分配包装任务</c:if>
			     <c:if test="${task.status eq '7'}">已包装</c:if>
			     <c:if test="${task.status eq '8'}">已分配发货任务</c:if>
			     <c:if test="${task.status eq '9'}">已发货</c:if>
			     <c:if test="${task.status eq '10'}">灯光拣选进行中...</c:if>
			     <c:if test="${task.status eq '11'}">推车拣选进行中...</c:if>
			     <c:if test="${task.status eq '12'}">发票打印</c:if>
               </td>
             </tr>
          </c:forEach>
	  </table>   
	  </div>
	  </div>
	  </div>
	  </div>
	  
	  
<div class="form-group row">
		<div class="col-md-12">
			<div class="box box-solid box-primary">
				<div class="box-header">
					<h3 class="box-title">作业任务信息</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse" type="button">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
	<div class="box-body">
	  <!-- 作业日志 -->	
	<table id="contentTable" class="table  table-bordered table-condensed">
		<thead><tr>
		    <th style="width: 100px;">处理人</th>
		    <th style="width: 170px;">处理时间</th>
			<th style="width: 100px;">处理环节</th>
			<th >描述</th>
		</tr></thead>
		<c:forEach  items="${logList}" var="log">
			 <tr>
		       <td>${log.work.realname}</td>
		       <td>${fn:substring(log.workTime,0,19)}</td>
		       <td>
		         <!-- 操作类型 (1.创建批次 2.创建任务 3.领取拣货任务  4.完成拣货任务 5.领取灯光拣选任务 6.完成灯光拣选任务  7.领取包装任务 8完成包装任务  9.领取发货任务  10.完成发货任务   ) -->
		          <c:if test="${log.workType eq '1' }">创建批次</c:if>
			      <c:if test="${log.workType eq '2' }">创建任务</c:if>
			      <c:if test="${log.workType eq '3' }">领取拣货任务</c:if>
			      <c:if test="${log.workType eq '4' }">完成拣货任务</c:if>
			      <c:if test="${log.workType eq '5' }">领取灯光拣选任务</c:if>
			      <c:if test="${log.workType eq '6' }">完成灯光拣选任务</c:if>
			      <c:if test="${log.workType eq '7' }">领取包装任务</c:if>
			      <c:if test="${log.workType eq '8' }">完成包装任务</c:if>
			      <c:if test="${log.workType eq '9' }">领取发货任务</c:if>
			      <c:if test="${log.workType eq '10' }">完成发货任务</c:if>
			       <c:if test="${log.workType eq '11' }">打印单据</c:if>
		       </td>
		       <td>${log.info}</td>
			 </tr>
		</c:forEach>
	</table>
	</div>
	</div>
	</div>
	</div>
</section>	
</body>
</html>
